package week4;


public class LinkedListTester {
    public static void main(String[] args) {
        LinkedUnorderedList list = new LinkedUnorderedList();
        System.out.println("添加学号到队列末尾：");
        list.addToRear(20172301);
        System.out.println("输出无序列表：");
        System.out.println(list.toString());
        System.out.println();
        System.out.println("添加到队列头部：");
        list.addToFront("十一过去了");
        System.out.println("输出无序列表：");
        System.out.println(list.toString());
        System.out.println();
        System.out.println("添加到队列头部：");
        list.addToFront("你好");
        System.out.println("输出无序列表：");
        System.out.println(list.toString());
        System.out.println();
        System.out.println("在“你好”后面添加：java");
        list.addAfter("java","你好");
        System.out.println("输出无序列表：");
        System.out.println(list.toString());
        System.out.println();
        System.out.println("添加到队列尾部：");
        list.addToRear("加油");
        System.out.println("输出无序列表：");
        System.out.println(list.toString());
        System.out.println();
        System.out.println("删除学号");
        list.remove(20172301);
        System.out.println("输出无序列表：");
        System.out.println(list.toString());
        System.out.println();
        System.out.println("删除列表第一个：");
        list.removeFirst();
        System.out.println("输出无序列表：");
        System.out.println(list.toString());
        System.out.println();
        System.out.println("删除列表最后一个：");
        list.removeLast();
        System.out.println("输出无序列表：");
        System.out.println(list.toString());
        System.out.println();

        LinkedOrderedList a = new LinkedOrderedList();

        a.add(1);
        a.add(5);
        a.add(2);
        a.add(10);
        a.add(8);
        System.out.println("输出有序列表：");
        System.out.println(a.toString());
        System.out.println("有序列表是否为空：" + a.isEmpty());
        System.out.println("查看列表第一个：" + a.first());
        System.out.println("查看列表最后一个：" + a.last());
        System.out.println("查看列表是否包含b：" + a.contains("b"));
        System.out.println("查看列表个数：" + a.size());

    }
}
